package api;

/**
 * @Author admin
 * @Date 2019/3/27 8:56
 */
public class T3 {
    public static void main(String[] args) {
        System.out.println("----1、添加----");
        StringBuffer sb=new StringBuffer();

        System.out.println("append");
        sb.append("abcdefg");
        System.out.println("添加结果是"+sb);
        sb.insert(2,13);
        System.out.println("tianjia "+sb);
        System.out.println("2.----删除-----");
        sb.delete(1,8);
        System.out.println(sb);
        sb.deleteCharAt(1);
        System.out.println("位置"+sb);
        sb.delete(0,sb.length());
        System.out.println("结果是"+sb);
        StringBuffer  sb2=new StringBuffer("sbcasd");
        System.out.println("3.----修改-----");
        sb2.setCharAt(1,'p');
        System.out.println("结果为"+sb2);
        sb2.replace(1,3,"qq");
        System.out.println("结果为"+sb2);
        sb2.reverse();
        System.out.println("结果为"+sb2);



    }
}
